package com.windowes.weichang.subscribe;

import com.windowes.weichang.service.DemandService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/***
 *
 * @author: yangqing
 * @email: qing.yang@bangdao-tech.com
 * @createTime: 2018/7/14 下午10:36
 * @description:
 *
 **/
@EnableScheduling
@Configuration
@Slf4j
public class WindowEScheduleTask {

    @Autowired
    DemandService demandService;

    /**
     * 每天23点50分做一次清理超期订单的操作
     * 如:超期时,服务停止的未通知的数据
     */
    @Scheduled(cron = "0 50 23 * * ?")
    public void clearUnHandle() {
        demandService.clearUnHandle();
    }
}
